As the use of personal computers and high resolution display and printer devices has proliferated over the past decade, the art of rendering and displaying fonts on pixel-oriented display devices has become much more refined. As is well known to those skilled in the art, a "font" is a collection of characters designed in a consistent style. Modem computer systems and applications now routinely support fonts in dozens of different typefaces and in various font sizes in response to the specific needs of users.
To keep pace with the growing demands of users, a specialized form of typography has developed that is devoted solely to the display of computer fonts. Expert font designers, also known as typographers, are responsible for creating aesthetically pleasing font designs. The fonts can be displayed on a wide variety of output devices. A typographer hand designs "outlines" of each character of the particular font. Each outline is comprised of a combination of straight lines and curves that form the shape of the character's outlines. A "glyph" refers to the filled outline of a character. Each glyph is composed of "stems", which are the straight or curved strokes. Stem widths are measured in an artificial measurement system called "design units" or "em units".
In order to render the font on a selected output device, the outlines are scaled according to the font size requested by the user and the characteristics of the output device on which it is to be displayed, i.e., its resolution. Thereafter, the outlines may be scan converted to produce a bitmap that can be rendered on the selected output device.
Fonts may by displayed on a wide variety of output devices. The most common output devices include raster scan cathode ray tube (CRT) displays, pixel-oriented LCD displays, dot matrix printers and laser printing devices. The resolution of any particular display device is specified by the number of dots or pixels per inch (dpi) that are to be displayed. For example, a Video Graphics Adapter (VGA) under OS/2 and "WINDOWS" operating systems is treated as a 96 dpi device, and many laser printers have a resolution of 300 dpi. Some devices, such as an Enhanced Graphics Adapter (EGA), have different resolution in the horizontal and vertical directions (i.e., non-square pixels); in the case of the EGA this resolution is 96.times.72.
As is well known in the art, a "pixel" is simply a discrete segment of an overall field in which an image can be displayed. In most devices, pixels are square or round in shape, but some pixel-oriented display devices include rectangular pixels. A pixel is either activated or not activated when the process that generates the display determines it is appropriate to activate that portion of the image field.
Users often desire to change the size of text that is displayed on an output device such as a display screen or a printer. Therefore, modem operating systems such as "WINDOWS", developed by Microsoft Corporation, the assignee of the present invention, and the operating system used on the Apple Macintosh computers provide displays that will display text from applications in varying fonts and in various sizes. The selection of character sizes is changed dynamically, and fonts can be changed independently of modifications to the stored text in memory or a disk file controlled by the application.
Because the resolution of output devices as well as the size of the font specified by the user can vary greatly, it is impossible to maintain the exact original font design while actually rendering the fonts on output devices. With very high resolution devices (e.g., a 600 dpi printer) or for large font sizes, it can be relatively easy to render the fonts close to the outline designs. However, as the resolution of the output device decreases and the size of the font becomes smaller, it becomes much more difficult to maintain the original design proportions. This is because the actual number of pixels used to render the font decreases. At low resolutions and/or small font sizes, most stem widths may be only one or two pixels wide. At low resolution/small sizes, however, the difference between a character stem width or an intercharacter space (i.e., the spacing between two adjacent characters) that is one pixel wide and one that is two pixels wide is very noticeable, and the wrong choice will often be distracting and unaesthetic.
As pixel-oriented output devices have achieved higher and higher resolution, it has become possible to display text in smaller and smaller characters on pixel-oriented output devices while still maintaining readability. However, as physical character size gets smaller for an output device of a given resolution, the potential and frequency of sampling errors such as dropout becomes greater.
To assist in the rendering of fonts at low resolution and/or small sizes, typographers typically use what is often referred to as an "autohinter", for example, the TypeMan autohinter, originally developed by Type Solutions, Inc. An "autohinter" is a set of programs that analyze the outlines of fonts and "hint" the fonts according to the size specified by the user and the resolution of the display device. "Hinting" generally refers to the process of making slight alterations to the boundaries of the glyph in order to fit it to pixel boundaries while distorting it as little as possible.
The fundamental task of hinting is to identify the critical characteristics of the original design and use instructions to ensure that those characteristics will be preserved when the glyph or outline is rendered at different sizes on different devices. Common goals include consistent stem weights, consistent color, even spacing, and the elimination of pixel dropouts.
One form of hinting is referred to as "grid fitting". Grid fitting refers to distorting character boundaries so that they lie on integral grid coordinates. The hinting of straight stems normally includes a slight translation of the character within a defined character area and may include widening or narrowing of glyph stems to assure that long straight stems cover an integer number of pixels.
The objective of an autohinter is to produce "hinted" outlines, in which each character has a small associated program called the "glyph program", and the font as a whole has an additional program called the "preprogram". These programs are stored with the font, to be invoked later by the document preparation system. When a user of such a system specifies a desired resolution and size for some text, the preprogram and glyph programs are invoked, and together convert widths measured in design units into widths measured in pixels, those widths being appropriate for the requested resolution and size. The widths measured in pixels are called "hinted" widths. The hinted widths must be a whole number of pixels, since each pixel is an atomic dot on the screen or printed page that is either black or white. Thus, the goal of the autohinter is to output a preprogram and glyph programs that will produce well-coordinated hinted widths, no matter what resolution or size the user later specifies.
There are several general principles of typography that should be followed in hinting stem widths. The most important principle is that at any given resolution and size, the ratio of any two hinted stem widths (measured in pixels) should approximate the ratio of those two stem widths in the original outlines (measured in design units). A particularly important special case of this principle is that at small sizes, two stem widths or intercharacter spaces that are close in the typographer's design should be rendered as equal widths, i.e., hint to an equal number of pixels.
A second important principle is that as the font size requested by the user increases, the hinted width of a given stem should not decrease. This is sometimes referred to as the principle of "monotonicity". A third, closely-related principle is that as the requested font size increases slowly, the hinted width of a given stem should increase smoothly rather than suddenly. For example, a given stem width should not change from two pixels to five pixels when the font size is incremented only slightly. Finally, the stem control system should allow convenient manual intervention by an expert typographer to allow fine tuning of the automatic hinter.
Previous stem control systems, such as Adobe Corporation's Type 1 autohinter, typically operate in the following manner. At small sizes, a small collection (between 1 and 24) of "standard" stem widths (e.g., the stems of 1-24 characters), specified by the font designer, are each scaled and rounded to the nearest pixel. Every other stem is then hinted to the closest standard stem width. At larger sizes, whenever a stem width scales to a value too far from that of any standard stem width, it is scaled and rounded to the nearest pixel, independent of the hinting of other stem widths.
These systems have proven to operate effectively at small sizes (where all stem widths should hint to one pixel according to the first principle of typography discussed above) and at very large sizes (where according to the same principle, each stem width should scale and round independently in order to preserve the proportions in the design). However, it has been found that these systems generally do not adequately preserve the design proportions at intermediate font sizes. For example, at a certain size, two stem widths that are very close in design units may hint to two different numbers of pixels, such as two and three pixels, respectively. This situation could arise if only one of the stem widths is still close enough to a standard stem width, or if one width scales to just below 2.5 pixels and the other scales to just above 2.5 pixels.
Furthermore, for prior stem control systems, the hinted width of a given stem may decrease as the requested font size increases. This is a violation of the second principle of typography discussed above.
Previous stem control systems also fail to provide a mechanism for the intended user, i.e., the typographer or font designer, to fine tone the output of the autohinter. In these systems, typically the only means of manual intervention is to actually change the code in the programs output by the autohinter. Thus, it is not possible for the typographer to control general specifications, for example, to change all sizes in a particular class of characters by a predetermined number of pixels.
Therefore, there is a need for an improved method for controlling stem width and intercharacter spacing that is adapted to make the transition smoothly and gradually from the smallest sizes (where all stem widths should hint to one pixel) to the largest sizes (where each stem width is scaled and rounded independently).
Furthermore, there is a need for an improved stem control system that allows for convenient manual intervention by an expert typographer for fine tuning the output of the autohinter.